import { createRouter, createWebHashHistory } from 'vue-router'

//制定路由规则
const routers = [
    {
        path: '/',
        name:'main',
        component: () => import('@/views/Main.vue'),
        redirect: '/login',
        children: []
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/Login.vue')
    },
];

const router = createRouter({
    // 设置路由模式
    history: createWebHashHistory(),
    // 赋予路由规则
    routes: routers
});

export default router;
